using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
class FormSize :Form
{

	static void Main()
	{
		Application.Run(new FormSize());
	}
	public FormSize()
	{
		Text="FormSize";
		BackColor=SystemColors.Window;//.White;
		ForeColor=SystemColors.WindowText;
	}
	protected override void OnMove(EventArgs ea)
	{
		Invalidate();
	}
	protected override void OnResize(EventArgs ea)
	{
		Invalidate();
	}

	protected override void OnPaint(PaintEventArgs pea)
	{
		Graphics g=pea.Graphics;
		Pen pen=new Pen(ForeColor);
		g.SmoothingMode=SmoothingMode.None;
		g.PixelOffsetMode=PixelOffsetMode.Default;
		g.DrawLine(pen,0,0,ClientSize.Width-1,ClientSize.Height-1);








//		Graphics g=pea.Graphics;
//		StringFormat strfmt=new StringFormat();
//		strfmt.Alignment=StringAlignment.Far;
//		strfmt.LineAlignment=StringAlignment.Far;
//		Brush brush=new SolidBrush(Color.YellowGreen);
//		g.DrawString("upper left corner",Font,brush,ClientSize.Width,100,strfmt);











//		string str="location"+Location+"\n"+
//				"size:"+Size+"\n"+
//				"Bounds"+Bounds+"\n"+
//				"Width"+Width+"\n"+
//				"Height"+Height+"\n"+
//				"Left"+Left+"\n"+
//				"top"+Top+"\n"+
//				"Right"+Right+"\n"+
//				"Bottom"+Bottom+"\n"+
//				"DeskTopLocation"+DesktopLocation+"\n"+
//				"DesktopBounds"+DesktopBounds+"\n"+
//				"ClientSize"+ClientSize+"\n"+
//				"ClientRectangle"+ClientRectangle;
//		g.DrawString(str,Font,Brushes.BlueViolet,0,0);
////		Random rand=new Random();
////		g.Clear(Color.FromArgb(rand.Next(256),rand.Next(256),rand.Next(256)));
	}
}